package dao;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import model.LoginModel;

/**
 *
 * @author WELISSON
 */
public class LoginDAO extends GenericDAO{
    
    public boolean logar(LoginModel login) throws SQLException{
        
        String sql = "SELECT * FROM usuarios WHERE login = ? AND senha = ? ;";
        
        PreparedStatement stmt = getConn().prepareStatement(sql);
        String lg = login.getLogin();
        String snh = login.getSenha();
        stmt.setString(1, lg);
        stmt.setString(2, snh);
        
        ResultSet rs = stmt.executeQuery();
        return rs.next();
    }
    
    
}
